package April._29;


import java.util.ArrayList;

public class work2 {
    public static void main(String[] args) {

    }

    public Node findAfterX(ArrayList head, int x){
        if(head==null||x<=0){
            return null;
        }
        Node fast=(Node) head.get(x);
        Node slow= (Node) head.get(1);
        while (fast!=null){
            fast=fast.next;
            slow=slow.next;
        }
        return slow;
    }
}
